package com.cnooc.aicv.lmapp.model;

import lombok.Data;

import java.util.List;

@Data
public class LMDiagMsg {

    private String model;
    private List<Message> messages;
    private double temperature;
    private double top_p;
    private double repetition_penalty;
    private int max_tokens;

    public String getModel() {
        return model;
    }

    public List<Message> getMessages() {
        return messages;
    }

    public double getTemperature() {
        return temperature;
    }

    public double getTop_p() {
        return top_p;
    }

    public double getRepetition_penalty() {
        return repetition_penalty;
    }

    public int getMax_tokens() {
        return max_tokens;
    }
    //更新图片信息
    public void setBase64New(String base64Image) {
        for (Message m : messages) {
            //图片参数在user -》message
            if("user".equals(m.getRole())){
                Content content = m.getContent();
                content.setInputBase64(base64Image);
            }
        }
    }
    //更新提示词
    public void setPromptNew(String prompt) {
        for (Message m : messages) {
            //图片参数在user -》message
            if("user".equals(m.getRole())){
                Content content = m.getContent();
                content.setInputPrompt(prompt);
            }
        }
    }

    // ... other code
}